// const express = require('express')
const express = require('./my-express/index')

const app = express()

app.use(function (req, res, next) {
    res.send = function (data) {
        if (typeof data === 'object') {
            res.end(JSON.stringify(data))
        }
    }
    next()
})


app.get('/user', function (req, res) {
    res.send({ name: 1213 })
})

app.listen(3000, function () {
    console.log('server start port=3000')
})